﻿using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace BBPA.Admin.SYS.Draw
{
    public partial class List : ListPage
    {
        BLL.V_Draw bllList = new BLL.V_Draw();
        BLL.Draw bll = new BLL.Draw();
        protected void Page_Load(object sender, EventArgs e)
        {
            Master.show_btn_add = Master.show_btn_bat_del = Master.show_checkbox = Master.show_edit = false;
            //
            int StoreID = Security.GetCurrentStoreID();
            if (StoreID == 0) StoreID = DataTypePlus.requestInt(Request.QueryString["StoreID"]);
            int SupplierID = Security.GetCurrentSupplierID();
            if (SupplierID == 0) SupplierID = DataTypePlus.requestInt(Request.QueryString["SupplierID"]);
            if (StoreID > 0) Master.BasicSQL = StringPlus.SQLand(Master.BasicSQL, "StoreID=" + StoreID);
            if (SupplierID > 0) Master.BasicSQL = StringPlus.SQLand(Master.BasicSQL, "SupplierID=" + SupplierID);
            //
            if(Security.InUserType(new List<EnumHelper.UserType>(){EnumHelper.UserType.Supplier,EnumHelper.UserType.Store})){
                th_Name.Visible = false;
                Master.ArrayControlID_noVisible_cph_td.Add("tb_Name");
            }
        }
        public override DataSet get_Page_DataSet(string sql_, string orderby_, int pageFrom_, int pageTo_) { return bllList.GetListByPage(sql_, orderby_, pageFrom_, pageTo_); }
        
    }
}